<template>
  <div>
    <div class="recommand-title">
      <span class="iconfont icon-heart">&#xe85c;</span> 猜你喜欢
    </div>
    <ul>
      <router-link
        tag="li"
        class="list-item"
        :to="'/detail/' + item.id"
        v-for="item of recommendList"
        :key="item.id"
      >
        <div class="item-img">
          <img :src="item.imgUrl" alt="" />
        </div>
        <div class="item-img-tag">{{item.tag}}</div>
        <div class="item-info">
          <div class="inner-box">
            <div class="info-title">{{item.title}}</div>
            <div class="info-comment">
              <span class="iconfont icon-start">&#xe670;</span>
              <span class="iconfont icon-start">&#xe670;</span>
              <span class="iconfont icon-start">&#xe670;</span>
              <span class="iconfont icon-start">&#xe670;</span>
              <span class="iconfont icon-start">&#xe670;</span>
              <span class="comment-num">{{item.commentNum}}条评论</span>
            </div>
            <div class="info-price">
              <span class="price">
                ￥
                <em>{{item.price}}</em>
              </span>起
              <span class="district">{{item.district}}</span>
            </div>
          </div>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: "HomeRecommand",
  props: {
    recommendList: Array
  },
  data: function() {
    return {
      // recommandList: [{},{},{}]
    };
  }
};
</script>

<style lang="stylus" scoped>
@import '~styles/variables.styl';
@import '~styles/mixins.styl';

div {
  box-sizing: border-box;
}

.recommand-title {
  width: 100%;
  height: 0.8rem;
  line-height: 0.8rem;
  font-size: .32rem;
  padding: 0 0.2rem;
  background-color: #EEE;
}

.recommand-title .icon-heart {
  color: #ff4040;
}

.list-item {
  position: relative;
  display: flex;
  width: 100%;
  height: 2.4rem;
}

.list-item .item-img {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0.2rem;
}

.list-item .item-img img {
  width: 100%;
  height: 100%;
}

.list-item .item-img-tag {
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.02rem;
  height: 0.38rem;
  background-color: pink;
  background-image: url('https://img1.qunarzz.com/piao/fusion/1802/20/2ba6d10b17972e02.png'); 
  background-size: 100% 100%;
  font-size: 0.22rem;
  color: #fff;
  text-indent: 0.06rem;
  line-height: 0.38rem;
  border-bottom-right-radius: 40%;
  overflow: hidden;
}

.list-item .item-info {
  flex: 1;
  padding: 0.4rem 0.1rem;
  min-width: 0;
}

.list-item .item-info .inner-box {
  width: 100%;
  height: 100%;
}

.list-item .item-info .inner-box .info-title {
  width: 100%;
  height: 0.6rem;
  line-height: 0.6rem;
  font-size: 0.32rem;
  ellipsis();
}

.list-item .item-info .inner-box .info-comment {
  width: 100%;
  height: 0.4rem;
  line-height: 0.4rem;
  font-size: 0.24rem;
}

.list-item .item-info .inner-box .info-comment .icon-start {
  font-size: 0.2rem;
  color: #ffb436;
}

.list-item .item-info .inner-box .info-comment .comment-num {
  color: $lightTxtColor;
}

.list-item .item-info .inner-box .info-price {
  position: relative;
  width: 100%;
  height: 0.6rem;
  line-height: 0.6rem;
  color: $lightTxtColor;
}

.list-item .item-info .inner-box .info-price span {
  font-size: 0.24rem;
}

.list-item .item-info .inner-box .info-price .price {
  color: #ff8300;
}

.list-item .item-info .inner-box .info-price .price em {
  font-size: 0.4rem;
}

.list-item .item-info .inner-box .info-price .district {
  position: absolute;
  bottom: 0;
  right: 0.24rem;
}
</style>




